﻿using System;


public sealed class Logger
{
    #region create threadsafe singleton
    private static volatile Logger instance;
    private static object syncRoot = new Object();

    private Logger() { }

    public static Logger Instance
    {
        get
        {
            if (instance == null)
            {
                lock (syncRoot)
                {
                    if (instance == null)
                        instance = new Logger();
                }
            }
            return instance;
        }
    }
    #endregion

    #region messages
    private const String REPORT2COMPANY = "Please report error at flexipay.bugs@algosis.com.";

    public const String EXISTING_NAME = "Duplicate names are not allowed. Name entered is already existing.";
    public const String INVALID_NAME = "Please enter a valid NAME. Name should contain only alphanumeric characters. ";
    public const String INVALID_DATE = "Please enter a valid DATE. Date Format: 'yyyy-MM-dd'.";

    public const String ERROR_WHILE_DISPLAY = "Error occured while populating details. " + REPORT2COMPANY;
    public const String MANDATORY_FIELD = "All fields are Mandatory. Please enter valid values in all fields.";
    public const String SELECT_FORMULA = " Please Select formula to be applied.";

    public const String SLABS_NOT_EXIST = "The Slab selected does not exist in database. " + REPORT2COMPANY;
    public const String RULES_NOT_EXIST = "The Rule selected does not exist in database. " + REPORT2COMPANY;
    #endregion

    #region methods
    public static void Show(String message)
    {
        WebMsgBox.Show(message);
    }
    #endregion
}


